import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const login = r => require.ensure([], () => r(require('@/page/login')), 'login');
const manage = r => require.ensure([], () => r(require('@/page/manage')), 'manage');
const home = r => require.ensure([], () => r(require('@/page/home')), 'home');

const addShop = r => require.ensure([], () => r(require('@/page/addShop')), 'addShop');
const adminList = r => require.ensure([], () => r(require('@/page/adminList')), 'adminList');
const userList = r => require.ensure([], () => r(require('@/page/userList')), 'userList');
const explain = r => require.ensure([], () => r(require('@/page/explain')), 'explain');
const message = r => require.ensure([], () => r(require('@/page/message')), 'message');
const arrangeInfo = r => require.ensure([], () => r(require('@/page/arrangeInfo')), 'arrangeInfo');
//aaaa
const routes = [
	{
		path: '/',
		component: login
	},

	{
		path: '/manage',
		component: manage,
		name: '',
		children: [{
			path: '',
			component: home,
			meta: [],
		}, {
			path: '/addShop',
			component: addShop,
			meta: ['排课管理', '预约排课'],
		}, {
			path: '/arrangeInfo',
			component: arrangeInfo,
			meta: ['排课管理', '排课信息'],
		}, {
			path: '/userList',
			component: userList,
			meta: ['数据管理', '用户列表'],
		}, {
			path: '/message',
			component: message,
			meta: ['数据管理', '消息列表'],
		}, {
			path: '/adminList',
			component: adminList,
			meta: ['设置', '管理员设置'],
		}, {
			path: '/explain',
			component: explain,
			meta: ['说明', '说明'],
		}]
	}
]

export default new Router({
	routes,
	strict: process.env.NODE_ENV !== 'production',
})
